Page({
  data: {
    notices: [],
  },
  async onLoad() {
    // wx.utils.toast()
    // const res =await wx.http.get('/announcement')
    // console.log(res);
    this.getNotices()
  },
  async getNotices() {
    const { code, data } = await wx.http.get('/announcement')
    if (code !== 10000) return wx.utils.toast('获取公告失败')
    this.setData({
      notices: data,
    })
  },
})
